package com.tianyang.yukuaifu.business.auth.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tianyang.yukuaifu.R;
import com.tianyang.yukuaifu.business.main.bean.PosUserOutput;
import com.tianyang.yukuaifu.common.utils.CommonUtils;
import com.tianyang.yukuaifu.utils.VerifyUtil;

import java.util.ArrayList;

/**
 * Description：商户待授权
 * Created by xyj on 2024/3/8
 */
public class MerchantAuthorAdapter extends BaseQuickAdapter<PosUserOutput, BaseViewHolder> {

    public MerchantAuthorAdapter() {
        super(R.layout.item_merchant_author, new ArrayList<>());
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, PosUserOutput item) {
        if (item != null) {
            helper.setText(R.id.createTimeTv, VerifyUtil.checkString(item.getCreateDate()))
                    .setText(R.id.merchantNameTv, VerifyUtil.checkString(item.getMerchantName()))
                    .setText(R.id.nameTv, item.getName() + "（" + CommonUtils.getMerchantName(item.getMchType()) + "）" + item.getShortName())
                    .setText(R.id.phoneTv, "联系商家 " + item.getPhone())
                    .addOnClickListener(R.id.authTv);
        }
    }
}
